#pragma once
#include "DXAMLCommon.h"
#include "CReferenceCount.h"
#include "CValue.h"


class CDependencyObject;

class CDeferredAnimationOperation :
	public CReferenceCount
{
public: 
	enum DeferredOperation
	{
		DeferredSet = 0x0,
		DeferredClear = 0x1
	};

private: 
	CCoreServices * m_pCore;
	CDependencyObject * m_pDO;
	XUINT32 m_nCustomPropertyIndex;
	CValue m_vValue;

	enum CDeferredAnimationOperation::DeferredOperation m_operation;

	CDeferredAnimationOperation();
	HRESULT Init(CCoreServices * pCore, CDependencyObject * pDO, XUINT32 nCustomPropertyIndex, CValue * pValue, enum CDeferredAnimationOperation::DeferredOperation operation);
	HRESULT SetAnimatedValue();
	HRESULT ClearAnimatedValue();
public: 
	virtual ~CDeferredAnimationOperation();
	static HRESULT Create(CCoreServices * pCore, CDependencyObject * pDO, XUINT32 nCustomPropertyIndex, CValue * pValue, enum CDeferredAnimationOperation::DeferredOperation operation, CDeferredAnimationOperation * * ppDefereredOperation);
	HRESULT DoOperation();
};